package com.itheima.stock.mapper;

import com.itheima.stock.common.domian.PermissionDomain;
import com.itheima.stock.pojo.SysPermission;
import com.itheima.stock.vo.req.UserMenus;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Set;

/**
* @author hyn
* @description 针对表【sys_permission(权限表（菜单）)】的数据库操作Mapper
* @createDate 2022-05-30 01:02:49
* @Entity com.itheima.stock.pojo.SysPermission
*/
@Repository
public interface SysPermissionMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SysPermission record);

    int insertSelective(SysPermission record);

    SysPermission selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysPermission record);

    int updateByPrimaryKey(SysPermission record);

    /**
     * 查询所有的权限
     * @return
     */
    List<UserMenus> getPermissionEcho();

    /**
     * 查到1级对应的二级权限树
     * @param id
     * @return
     */
    List<UserMenus> getTwoPermissionEcho(@Param("id") String id);

    List<UserMenus> getThreePermissionEcho(@Param("id") String id);

    List<SysPermission> getAllPermissions();

    /**
     * 获取所有权限
     * @return
     */
    List<SysPermission> getPermissionTree();
}
